package websocketgulu.demo.Utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeConverter {
    public static String timeConverter(String time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date retStr = null;
        try {
            retStr = sdf.parse(time);
        } catch (Exception exception) {}
        return sdf.format(retStr);
    }

    public static void main(String[] args) {
        System.out.println(timeConverter("2021-08-3 9:55:56"));
    }
}
